﻿<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>@ViewBag.Title - My ASP.NET MVC Application</title>
        <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />
        @Styles.Render("~/content/css")
        @Styles.Render("~/Content/css")      
       
        @Scripts.Render("~/bundles/modernizr")
        @Scripts.Render("~/js")
        <style>
            table.center {
                margin-left:auto; 
                margin-right:auto;
                width:99%;
            }
            /*.navbar-default {
                background-color: #563d7c;
                border-color: #463265;
                box-shadow: 0 1px 0 rgba(255,255,255,.1);
            }*/
            .table.table-hover {
                /*border:1px solid #000;*/
            }
        </style>
    </head>
    <body>

        <nav class="navbar navbar-default " role="navigation">
            <div class="navbar-header "><a class="navbar-brand" href="@Url.Action("Index","Home")">ร้านเจริญศักดิ์</a></div>
            

            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">

           @if(User.Identity.IsAuthenticated) 
           {
               if(User.Identity.Name.Equals("admin",StringComparison.CurrentCultureIgnoreCase))
               { 
                    <li><a href="@Url.Action("Index","Member")"><span class="glyphicon glyphicon-user"></span> บัญชีผู้ใช้ทั้งหมด</a></li>
                                    <li><a href="@Url.Action("Index","Product")"><span class="glyphicon glyphicon-list"></span> จัดการของเก่า</a></li>
                                    <li class="divider"></li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-bell"></span> รายงานการซื้อ-ขายของเก่า <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="@Url.Action("Index","Report")"><span class="glyphicon glyphicon-shopping-cart"></span> รายงานการซื้อของเก่า</a></li>
                            <li><a href="@Url.Action("Index","SellReport")"><span class="glyphicon glyphicon-shopping-cart"></span> รายงานการขายของเก่า</a></li>
                        </ul>
                    </li>                     
                    <li class="divider"></li>
                    <li><a href="@Url.Action("Index","Factor")"><span class="glyphicon glyphicon-th"></span> จัดการปัจจัย</a></li>                    
                    <li><a href="../ReportingPages/Graphs/YearSummary.aspx"><span class="glyphicon glyphicon-eye-open"></span> กราฟ-ทำนาย</a></li>
                }
               
                <li><a href="@Url.Action("Index","Buy")"><span class="glyphicon glyphicon-shopping-cart"></span> ซื้อของเก่า</a></li>
                <li><a href="@Url.Action("Index","Sell")"><span class="glyphicon glyphicon-usd"></span> ขายของเก่า</a></li>
           }
                                    
                 @*   @if (User.Identity.IsAuthenticated) 
                    {
                        //if (User.Identity.Name == "Admin")
                        {
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-lock"></span> เจ้าของธุรกิจ <b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    <li><a href="@Url.Action("Index","Member")"><span class="glyphicon glyphicon-user"></span> จัดการบัญชีผู้ใช้</a></li>
                                    <li><a href="@Url.Action("Index","Product")"><span class="glyphicon glyphicon-list"></span> จัดการของเก่า</a></li>
                                    <li class="divider"></li>
                                    <li><a href="@Url.Action("Index","Report")"><span class="glyphicon glyphicon-shopping-cart"></span> ประวัติการซื้อขาย</a></li>
                                    <li class="divider"></li>
                                    <li class="disabled" ><a href="#"><span class="glyphicon glyphicon-stats"></span> กราฟ</a></li>
                                    <li class="disabled" ><a href="#"><span class="glyphicon glyphicon-eye-open"></span> ทำนาย</a></li>
                                </ul>
                            </li>
                        }
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-bell"></span> พนักงาน <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                              <li><a href="@Url.Action("Index","Buy")"><span class="glyphicon glyphicon-shopping-cart"></span> ซื้อของเก่า</a></li>
                              <li><a href="@Url.Action("Index","Sell")"><span class="glyphicon glyphicon-usd"></span> ขายของเก่า</a></li>
                            </ul>
                        </li>
                    }*@

                </ul> 
                <ul class="nav navbar-nav navbar-right">
                    @if (User.Identity.IsAuthenticated) 
                    {
                        <li><a class="glyphicon glyphicon-user">-@User.Identity.Name</a></li>
                        <li class="active"><a href="javascript:document.getElementById('logoutForm').submit()"><span class="glyphicon glyphicon-log-out"></span> ออกจากระบบ</a></li>
                    }
                    else
                    {
                        @*<li class="active"><a href="@Url.Action("Login","Account")"><span class="glyphicon glyphicon-log-in"></span> เข้าสู่ระบบ</a></li>*@
                    }
                </ul>
          </div>
        </nav>

        @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" })) {
            @Html.AntiForgeryToken()
        }

        @*<header>
                <div class="float-right">
                    <section id="login">
                        @Html.Partial("_LoginPartial")
                    </section>
                    <nav>
                        <ul id="menu">
                            @Html.ActionLink("สิทธิ์", "Index", "Privilege") |
                            @Html.ActionLink("สมาชิก", "Index", "Member") |
                            @Html.ActionLink("ของเก่า", "Index", "Product") |
                            @Html.ActionLink("ประเภทของเก่า", "Index", "Category") |
                            @Html.ActionLink("ราคาของเก่า", "Index", "ProductPricingPerUnit") |
                            @Html.ActionLink("หน่วยของเก่า", "Index", "ProductUnit")
                        </ul>
                    </nav>
                </div>
            </div>
        </header>*@
        <div id="body">
            @RenderSection("featured", required: false)
            <section class="content-wrapper main-content clear-fix">
                <table class="center">
                    <tr><td>@RenderBody()</td></tr>
                </table>
            </section>
        </div>
       

        @Scripts.Render("~/bundles/jquery")
        @RenderSection("scripts", required: false)
    </body>
</html>
